package com.prd.controller;


import com.prd.dto.SysDepartmentLetterDTO;
import com.prd.service.SysDepartmentLetterService;
import com.prd.util.JsonData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 部门责任书 前端控制器
 * </p>
 *
 * @author lizhaoyi
 * @since 2024-01-04
 */
@RestController
@RequestMapping("/api/sysDepartmentLetter")
@Api(tags = "部门责任书")
public class SysDepartmentLetterController {

    @Autowired
    private SysDepartmentLetterService sysDepartmentLetterService;

    @ApiOperation("添加部门责任书")
    @PostMapping("add")
    public JsonData addDepartLetter(@RequestBody SysDepartmentLetterDTO sysDepartmentLetterDTO){

        return sysDepartmentLetterService.addDepartLetter(sysDepartmentLetterDTO);
    }

    @ApiOperation("查看部门责任书")
    @PostMapping("detail")
    public JsonData detail(@ApiParam("部门id") @RequestParam Long id){

        return sysDepartmentLetterService.detail(id);
    }

    @ApiOperation("修改部门责任书")
    @PostMapping("edit")
    public JsonData edit(@RequestBody SysDepartmentLetterDTO sysDepartmentLetterDTO){

        return sysDepartmentLetterService.edit(sysDepartmentLetterDTO);
    }

}

